<form name="form" ng-init="vm.init();refresh(vm.callback);" novalidate>
  <script id="opt-toolbar" type="text/ng-template">
    <div>
      <button class="btn btn-default" ng-disabled="form.$invalid || !vm.parsable || !vm.hasText"
          type="button" ng-click="vm.evaluate(form.$valid)"><i class="fa fa-random"></i> 推导</button>
      <div class="btn-group x-btn-list">
        <button id="copy" class="btn btn-default" type="button" ng-disabled="vm.code == ''">
          <i class="fa fa-copy"></i> 复制</button>
        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
            ng-disabled="vm.code == ''">
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu">
          <li><button type="button" class="btn btn-default btn-block" ng-click="vm.save()">保存文件</button></li>
        </ul>
      </div>
      <button class="btn btn-default" type="button" ng-click="vm.reset()">
        <i class="fa fa-repeat"></i> 重置</button>
    </div>
  </script>
  <div class="row x-view-body" movezone="{ratio:-1}">
    <div class="col-md-7 col-xl-6">
      <div class="x-view-scope">
        <div class="x-evalcheck">
          <div class="form-group">
            <div class="input-group">
              <span class="input-group-addon">包名.类名</span>
              <input type="text" name="pojo" class="form-control" placeholder="package.name.ClassName" autofocus
                  ng-model="vm.pojo" required ng-class="{'x-invalid': form.$submitted && form.pojo.$invalid}">
              <span class="input-group-addon">.java</span>
            </div>
          </div>
          <div class="form-group">
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.primitive">使用基本类型
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.gettersAndSetters">包含Getters和Setters
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.constructor">包含构造器
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.hashCodeAndEquals">包含hashCode和equals
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.toString">包含toString
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.serializable">标记为Serializable
            </label>
          </div>
          <div class="form-group">
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.builder">使用Builder方式
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.commentAndAnnotation">注释和注解
            </label>
            <label class="checkbox-inline">
              <input type="checkbox" ng-model="vm.config.lombok.checked">使用Lombok注解
            </label>
            <div class="checkbox-inline x-checkbox-list" style="margin-left:0" ng-show="vm.config.lombok.checked">
              <a href="javascript:void(0)" data-toggle="dropdown">Lombok<span class="caret"></span></a>
              <ul class="dropdown-menu" ng-click="$event.stopPropagation()">
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.data">Data</label>
                </li>
                <li class="divider"></li>
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.getter">Getter</label>
                </li>
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.setter">Setter</label>
                </li>
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.toString">ToString</label>
                </li>
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.equalsAndHashCode">EqualsAndHashCode</label>
                </li>
                <li class="divider"></li>
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.noArgsConstructor">NoArgsConstructor</label>
                </li>
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.requiredArgsConstructor">RequiredArgsConstructor</label>
                </li>
                <li class="checkbox">
                  <label><input type="checkbox" ng-model="vm.config.lombok.allArgsConstructor">AllArgsConstructor</label>
                </li>
              </ul>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label">文本类型：</label>
            <label class="radio-inline">
              <input type="radio" name="textType" value="json" ng-model="vm.config.textType">JSON
            </label>
            <label class="radio-inline">
              <input type="radio" name="textType" value="xml" ng-model="vm.config.textType">XML
            </label>
            <label class="radio-inline">
              <input type="radio" name="textType" value="sql" ng-model="vm.config.textType">SQL
            </label>
            <font color="green">（值类型标识符：{type:Object}）</font>
          </div>
        </div>
        <div class="x-evaltext">
          <div class="x-editor">
            <pre id="text-editor"></pre>
          </div>
        </div>
      </div>
    </div>
    <div class="col-md-5 col-xl-6">
      <div class="x-view-scope">
        <div class="x-editor">
          <pre class="x-output" id="java-viewer"></pre>
        </div>
      </div>
    </div>
  </div>
</form>
